// const p1 = new Promise((resolve, reject) => {
//     resolve('ok')
// })

// p1.then(
//     res => {
//         console.log(res);
//     },
//     err => {
//         console.log(err);
//     }
// )

// const p2 = new Promise((resolve, reject) => {
//     setTimeout(() => {
//         reject('error')
//     }, 1000)
// }).then(res => console.log(res), err => console.log(err))

// const p3 = new Promise((resolve, reject) => {
//     resolve(100)
// })
//     .then(res => 2 * res, err => console.log(err))
//     .then(res => console.log(res), err => console.log(err))

const p4 = new Promise((resolve, reject) => {
    resolve(100)
})
    .then(res => new Promise(resolve => resolve(3 * res)), err => console.log(err))
    .then(res => console.log(res), err => console.log(err))
